#!/bin/bash

set -e

if [[ "${is_minimal}" = "true" ]]; then
    return 0
elif [[ "${is_ghost}" = "true" ]]; then
    return 0
fi

LANGUAGE=$(get_value language)

echo "zh_CN.UTF-8 UTF-8
en_US.UTF-8 UTF-8
bo_CN.UTF-8 UTF-8" >/etc/locale.gen

msg "设置语言为 ${LANGUAGE}"
echo "LANG=${LANGUAGE}.UTF-8" >/etc/default/locale
if [[ "${LANGUAGE}" = "zh_CN" ]]; then
    echo "LANGUAGE=\"zh_CN:zh\"" >>/etc/default/locale
fi

locale-gen
